#! /bin/sh
set -x
 
#
# This script produces a velocity model for the modelling
#
# To view the model type:
#  ximage < velocity.dir n1=100
#
#
# Stig-Kyrre Foss, 29.Oct 2001

ninf=1 nx=100 nz=100
dx=5 dz=5
fx=0.0 fz=0.0
v00=1500.,2500.
dvdx=0.0
npmax=100
dvdz=0.0,0.0

unif2 < boundaries > vpsmtest.dir nx=$nx nz=$nz ninf=$ninf dx=$dx dz=$dz\
     dvdx=$dvdx v00=$v00 dvdz=$dvdz npmax=$npmax
     
v00=0.,500.

    
unif2 < boundaries > vssmtest.dir nx=$nx nz=$nz ninf=$ninf dx=$dx dz=$dz\
     dvdx=$dvdx v00=$v00 dvdz=$dvdz npmax=$npmax 

v00=1000.,1100.

unif2 < boundaries > rhosmtest.dir nx=$nx nz=$nz ninf=$ninf dx=$dx dz=$dz\
     dvdx=$dvdx v00=$v00 dvdz=$dvdz npmax=$npmax

v00=0.,0.

unif2 < boundaries > deltasmtest.dir nx=$nx nz=$nz ninf=$ninf dx=$dx dz=$dz\
     dvdx=$dvdx v00=$v00 npmax=$npmax

v00=0.,0.

unif2 < boundaries > epsilonsmtest.dir nx=$nx nz=$nz ninf=$ninf dx=$dx dz=$dz\
     dvdx=$dvdx v00=$v00 npmax=$npmax 

cp epsilonsmtest.dir dummy_zero.dir

#   Transform into stiffness coefficients
vpfile=vpsmtest.dir
vsfile=vssmtest.dir
rhofile=rhosmtest.dir
epsfile=epsilonsmtest.dir
deltafile=deltasmtest.dir
gammafile=gamma_lens
c11_file=c11smtest.dir
c13_file=c13smtest.dir
c33_file=c33smtest.dir
c44_file=c44smtest.dir 
c66_file=c66smtest.dir

vel2stiff vpfile=$vpfile vsfile=$vsfile rhofile=$rhofile epsfile=$epsfile \
	deltafile=$deltafile nx=$nx nz=$nz \
	c11_file=$c11_file c13_file=$c13_file c33_file=$c33_file \
	c44_file=$c44_file c66_file=$c66_file

exit 0    




